import {html, TemplateResult} from 'lit';
import type {Meta, StoryObj} from '@storybook/web-components';
import "../../../echarts/radar/lit-radar.ts"
import {RadarProps} from "../../../echarts/radar/lit-radar.ts";

const meta: Meta<RadarProps> = {
    title: 'Echarts/LitRadar',
    tags: ['autodocs'],
    render: (args: RadarProps): TemplateResult => {
        return html`<lit-radar 
            .chartId=${args.chartId}
            .width=${args.width}
            .height=${args.height}
            .title=${args.title}
            .legend=${args.legend}
            .radarIndicator=${args.radarIndicator}
            .seriesName=${args.seriesName}
            .seriesData=${args.seriesData}
        />`;
    },
    argTypes: {
        chartId: { control: 'text' },
        width: { control: 'text' },
        height: { control: 'text' },
        title: { control: 'object' },
        legend: { control: 'object' },
        radarIndicator: { control: 'object' },
        seriesName: { control: 'text' },
        seriesData: { control: 'object' },
    },
};

export default meta;
type Story = StoryObj<RadarProps>;

export const BasicRadar: Story = {
    args: {
        chartId: 'basic-radar-chart',
        width: '1200px',
        height: '600px',
        title: {
            text: 'Basic Radar Chart'
        },
        legend: ['Allocated Budget', 'Actual Spending'],
        radarIndicator: [
            { name: 'Sales', max: 6500 },
            { name: 'Administration', max: 16000 },
            { name: 'Information Technology', max: 30000 },
            { name: 'Customer Support', max: 38000 },
            { name: 'Development', max: 52000 },
            { name: 'Marketing', max: 25000 }
        ],
        seriesName: 'Budget vs Spending',
        seriesData: [
            [4320, 3000, 20000, 35000, 50000, 18000],
            [5000, 14000, 28000, 26000, 42000, 21000]
        ]
    }
};